import request from '@/utils/request'
import { getToken } from '@/utils/auth'

// 获取价签
export function getPartnerMasterPrice(params) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/priceTag/getPartnerMasterPrice',
    method: 'get',
    params: params
  })
}

// 获取价签
export function getPartnerMasterPriceBySubsidy(params) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/priceTag/getPartnerMasterPriceBySubsidy',
    method: 'get',
    params: params
  })
}

// 获取基准价签
export function getChargeList(params) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/charge/getChargeList',
    method: 'get',
    params: params
  })
}

// 保存服务价签
export function savePartnerMasterPrice(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/priceTag/savePartnerMasterPrice',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

// 保存服务价签
export function copyPartnerMasterPrice(params) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/priceTag/copyPartnerMasterPrice',
    method: 'get',
    params: params
  })
}

// 保存服务价签(多个)
export function saveList(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/priceTag/save',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

// 删除服务价签
export function removePartnerMasterPrice(params) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/partner/priceTag/delete',
    method: 'get',
    params: params
  })
}
